<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
if($type == 1){
    $this->title = '供货信息管理';
}else{
    $this->title = '求购信息管理';
}

$this->params['breadcrumbs'][] = $this->title;
?>
<div class="supply-index">

    <p>
        <?= Html::a($type == 1 ? '创建供货信息' : '创建求购信息', ['create' , 'type' => $type], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'title',
            'create_time:datetime',
            // 'update_time:datetime',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>

</div>
